﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JXT.PrimaryKey.Batman.Domain.Models;

namespace JXT.PrimaryKey.Batman.Domain.UserSystem.Models
{
    [Serializable]
    public class Authority : ValueObjectBase<Authority>
    {
        public int TemplateId { get; set; }

        public string Name { get; set; }

        public string Summary { get; set; }

        public AuthorityType Type { get; set; }

        public PriorityType Priority { get; set; }

        public string Value { get; set; }

        public DateTime? ExpiresTime { get; set; }

        public override bool Equals(Authority other)
        {
            if (other == null)
                return false;
            if (Value == null || other.Value == null)
                return Value == other.Value;
            return TemplateId == other.TemplateId &&
                Name == other.Name &&
                Summary == other.Summary &&
                Type == other.Type &&
                Priority == other.Priority &&
                Value == other.Value &&
                ExpiresTime == other.ExpiresTime;
        }
    }
}
